﻿using Coldairarrow.Entity.DTO;
using Coldairarrow.Entity.TD;
using Coldairarrow.Util;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace Coldairarrow.Business.TD
{
    public partial interface ITD_ScrapBusiness
    {
        Task<PageResult<TD_Scrap>> GetDataListAsync(PageInput<ConditionDTO> input);
        Task<TD_Scrap> GetTheDataAsync(string id);
        Task AddDataAsync(TD_Scrap data);
        Task UpdateDataAsync(TD_Scrap data);
        Task DeleteDataAsync(List<string> ids);
        /// <summary>
        /// 保存待维订单
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        Task AddScrapInfo(TD_ScrapInfo data);
        /// <summary>
        /// 编辑保存待维报废订单
        /// </summary>
        /// <param name="Data"></param>
        /// <returns></returns>
        Task UpdateScrapInfo(TD_ScrapInfo Data);
        /// <summary>
        /// 查看待维报废订单
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        Task<TD_ScrapMainList> GetScrapMainList(string Id);
        /// <summary>
        /// PDA报废出库扫码
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        Task GetAdd(TD_ScrapData data);
        /// <summary>
        /// 报废出库扫码单个物料或包获取报废单剩余出库数量
        /// </summary>
        /// <param name="QrCode">报废单二维码</param>
        /// <param name="LocationQrCode">货位二维码</param>
        /// <param name="MaterialQrCode">物料包码</param>
        /// <returns></returns>
        Task<ScrapOutDetail> GetScrapOutDetail(string QrCode,string LocationQrCode,string MaterialQrCode);
        Task<TD_Scrap> GetAllScrap(string QrCode);
        /// <summary>
        /// PDA扫码报废单获取明细数据
        /// </summary>
        /// <param name="stockupQrCode"></param>
        /// <returns></returns>
        Task<List<PB_UnLoadListDataDTO>> GetStockUpDetailListDataAsync(string stockupQrCode);
       /// <summary>
       /// PDA报废单移除
       /// </summary>
       /// <param name="stockupQrCode"></param>
       /// <param name="packqrocde"></param>
       /// <param name="locationId"></param>
       /// <param name="Nums"></param>
       /// <returns></returns>
        Task DeleteStockUpDetailListDataAsync(string stockupQrCode, string packqrocde, string locationId, double Nums);
        /// <summary>
        /// PDA报废出库
        /// </summary>
        /// <param name="ScrapId">报废单Id</param>
        /// <returns></returns>
        Task SubmitScrapDataAsync(string ScrapId);
        Task ToScrapexamine(string Id);
        Task<List<TD_ScrapDetailDto>> GetScrapDetailDto(string Parentid, string LocationId, string MaterName);
    }
    /// <summary>
    /// 待维报废订单保存
    /// </summary>
    public class TD_ScrapInfo :TD_Scrap{
       
        public List<TD_ScrapDetailDto> Detailinfo { get; set; }
    }

    public class TD_ScrapMainList : TD_Scrap {
        public List<TD_ScrapDetailDto> Detail { get; set; }
    }
    public class TD_ScrapDetailDto: TD_ScrapDetail
    {


        /// <summary>
        /// 报废单二维码
        /// </summary>
        public string QrCode { get; set; }
        /// <summary>
        /// 物料名称
        /// </summary>
        public string MaterialIdName { get; set; }
        /// <summary>
        /// 货位名称
        /// </summary>
        public string LocalIdName { get; set; }
        /// <summary>
        /// 物料code
        /// </summary>
        public string materialCode { get; set; }
        /// <summary>
        /// 物料规格
        /// </summary>
        public string MaterSpec { get; set; }
        public string materialId { get; set; }
        /// <summary>
        /// 库存数量
        /// </summary>
        public string InventoryQuantity { get; set; }

        public string StoareaName { get; set; }
        public string RackName { get; set; }
        public double? Num { get; set; }
        public string LocalId { get; set; }

     

    }
    public class TD_ScrapData {
        /// <summary>
        /// 报废单二维码
        /// </summary>
        public string QrCode { get; set; }
        /// <summary>
        /// 货位二维码
        /// </summary>
        public string LocationQrCode { get; set; }
        /// <summary>
        /// 物料二维码
        /// </summary>
        public string MaterialQrCode { get; set; }
        /// <summary>
        /// 报废数量
        /// </summary>
        public double? Nums { get; set; }
    }

    public class ScrapOutDetail {
        /// <summary>
        /// 报废单二维码
        /// </summary>
        public string QrCode { get; set; }
        /// <summary>
        /// 货位二维码
        /// </summary>
        public string LocationQrCode { get; set; }
        /// <summary>
        /// 物料Code
        /// </summary>
        public string MaterialQrCode { get; set; }
        /// <summary>
        /// 物料名称
        /// </summary>
        public string Name { get; set; }
        /// <summary>
        /// 物料编码
        /// </summary>
        public string Code { get; set; }
        /// <summary>
        /// 规格
        /// </summary>
        public string Spec { get; set; }
        /// <summary>
        /// 报废数量
        /// </summary>
        public double? ScrapNums { get; set; }
        /// <summary>
        /// 货位名称
        /// </summary>
        public string LocationName { get; set; }
        /// <summary>
        /// 待出库数量
        /// </summary>
        public double? QuantityNums { get; set; }
    }

    /// <summary>
    /// PDA报废出库获取出库明细信息
    /// </summary>
    public class TD_ScrapDetailPriceDTO : TD_ScrapDetail
    {
        public Double? Price { get; set; }
    }
}